<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>{$title}</title>
    <style>
        .zt{
            font-size:16px;
            font-family:微软雅黑;
        }
        .pd{
            padding:0;
        }
        .mt{
            margin-top:50px;
        }
        .mt1{
            margin-top:10px;
        }
    </style>

    <!-- Bootstrap -->
    <link href="__PUBLIC__/admin/bootstrap/css/bootstrap.min.css" rel="stylesheet">
</head>

<body>
    <div class="container">
        <div class="row">
            <div class="col-md-12">
            <block name="main">
            <div class="panel panel-primary">
                <div class="panel-heading zt" style="text-align:center;">{$title}</div>
                <div class="panel-body">
                    <center>
                        <ul class="nav nav-tabs zt">
                            <li><a href="#nopay" data-toggle="tab">已下单</a></li>
                            <li><a href="#payed" data-toggle="tab">已付款</a></li>
                            <li><a href="#unfinished" data-toggle="tab">已发货</a></li>
                            <li><a href="#finished" data-toggle="tab">已到货</a></li>
                        </ul>
                    </center>
                    <div class="tab-content">
                        <div class="tab-pane active" id="nopay">
                            <table class="table table-hover zt">
                                <tr>
                                    <th>订单编号</th>
                                    <th>收货人</th>
                                    <th>商品总额</th>
                                    <th>收货人手机</th>
                                    <th>收货地址</th>
                                    <th>下单时间</th>
                                    <th>详情</th>
                                </tr>
                                <volist name="list1" id="v">
                                <tr>
                                    <td>{$v.order_id}</td>
                                    <td>{$v.username}</td>
                                    <td>{$v.monery}</td>
                                    <td>{$v.phone}</td>
                                    <td>{$v.address}</td>
                                    <td>{$v.atime|date="Y-m-d H:i:s",###}</td>
                                    <td>
                                        <!-- Button trigger modal -->
                                        <button type="button" data-toggle="modal" data-target="#myModal{$v.id}"><span class="glyphicon glyphicon-pencil"></span></button>

                                        <!-- Modal -->
                                        <div class="modal fade" id="myModal{$v.id}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                                          <div class="modal-dialog">
                                            <div class="modal-content">
                                                <div class="modal-header">
                                                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                                                <h4 class="modal-title" id="myModalLabel">订单详情</h4>
                                                </div>
                                                <div class="modal-body">
                                                    <ul style="list-style:none;">
                                                        <li>商品编号:{$v.order_id}</li>
                                                        <li>订单状态:<if condition="$v.status eq '0'">已下单</if></li>
                                                        <li>商品信息:
                                                            <ul style="list-style:none;">
                                                                <li>商品名称:</li>
                                                                <li>商品名称:</li>
                                                                <li>商品名称:</li>
                                                                <li>商品名称:</li>
                                                            </ul>
                                                        </li>
                                                        <li>订单总价:{$v.monery}</li>
                                                        <li>收货人:{$v.username}</li>
                                                        <li>联系电话:{$v.phone}</li>
                                                    </ul>
                                                </div>
                                                <div class="modal-footer">
                                                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                                                    <button type="button" class="btn btn-primary">保存</button>
                                                </div>
                                            </div>
                                          </div>
                                        </div>
                                    </td>
                                </tr>
                                </volist>
                            </table>
                        </div>
                        <div class="tab-pane" id="payed">
                            <table class="table table-hover zt">
                                <tr>
                                    <th>订单编号</th>
                                    <th>收货人</th>
                                    <th>商品总额</th>
                                    <th>收货人手机</th>
                                    <th>收货地址</th>
                                    <th>下单时间</th>
                                    <th>详情</th>
                                </tr>
                                <volist name="list2" id="v">
                                <tr>
                                    <td>{$v.order_id}</td>
                                    <td>{$v.username}</td>
                                    <td>{$v.monery}</td>
                                    <td>{$v.phone}</td>
                                    <td>{$v.address}</td>
                                    <td>{$v.atime|date="Y-m-d H:i:s",###}</td>
                                    <td>
                                        <!-- Button trigger modal -->
                                        <button type="button" data-toggle="modal" data-target="#myModal{$v.id}"><span class="glyphicon glyphicon-pencil"></span></button>

                                        <!-- Modal -->
                                        <script></script>
                                        <div class="modal fade" id="myModal{$v.id}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                                          <div class="modal-dialog">
                                            <div class="modal-content">
                                                <div class="modal-header">
                                                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                                                <h4 class="modal-title" id="myModalLabel">订单详情</h4>
                                                </div>
                                                <div class="modal-body">
                                                    <ul style="list-style:none;">
                                                        <li>商品ID:{$v.id}</li>
                                                        <li>商品编号:{$v.order_id}</li>
                                                        <li id="if">订单状态:<if condition="$v.status eq '1'">已付款</if>
                                                            <button id="btn{$v.id}" class="post" data_index="{$v.id}">一键发货</button>
                                                        </li>
                                                        <li>商品信息:
                                                            <ul style="list-style:none;">
                                                                <li>商品名称:</li>
                                                                <li>商品名称:</li>
                                                                <li>商品名称:</li>
                                                                <li>商品名称:</li>
                                                            </ul>
                                                        </li>
                                                        <li>订单总价:{$v.monery}</li>
                                                        <li>收货人:{$v.username}</li>
                                                        <li>收货地址:{$v.address}</li>
                                                        <li>联系电话:{$v.phone}</li>
                                                    </ul>
                                                </div>
                                                <div class="modal-footer">
                                                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                                                    <button type="button" class="btn btn-primary">保存</button>
                                                </div>
                                            </div>
                                          </div>
                                        </div>
                                    </td>
                                </tr>
                                </volist>
                            </table>
                        </div>
                        <div class="tab-pane" id="unfinished">
                            <table class="table table-hover zt">
                                <tr>
                                    <th>订单编号</th>
                                    <th>收货人</th>
                                    <th>商品总额</th>
                                    <th>收货人手机</th>
                                    <th>收货地址</th>
                                    <th>下单时间</th>
                                    <th>详情</th>
                                </tr>
                                <volist name="list3" id="v">
                                <tr>
                                    <td>{$v.order_id}</td>
                                    <td>{$v.username}</td>
                                    <td>{$v.monery}</td>
                                    <td>{$v.phone}</td>
                                    <td>{$v.address}</td>
                                    <td>{$v.atime|date="Y-m-d H:i:s",###}</td>
                                    <td>
                                        <!-- Button trigger modal -->
                                        <button type="button" data-toggle="modal" data-target="#myModal{$v.id}"><span class="glyphicon glyphicon-pencil"></span></button>

                                        <!-- Modal -->
                                        <div class="modal fade" id="myModal{$v.id}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                                          <div class="modal-dialog">
                                            <div class="modal-content">
                                                <div class="modal-header">
                                                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                                                <h4 class="modal-title" id="myModalLabel">订单详情</h4>
                                                </div>
                                                <div class="modal-body">
                                                    <ul style="list-style:none;">
                                                        <li>商品编号:{$v.order_id}</li>
                                                        <li>订单状态:<if condition="$v.status eq '2'">已发货</if></li>
                                                        <li>商品信息:
                                                            <ul style="list-style:none;">
                                                                <li>商品名称:</li>
                                                                <li>商品名称:</li>
                                                                <li>商品名称:</li>
                                                                <li>商品名称:</li>
                                                            </ul>
                                                        </li>
                                                        <li>订单总价:{$v.monery}</li>
                                                        <li>收货人:{$v.username}</li>
                                                        <li>联系电话:{$v.phone}</li>
                                                    </ul>
                                                </div>
                                                <div class="modal-footer">
                                                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                                                    <button type="button" class="btn btn-primary">保存</button>
                                                </div>
                                            </div>
                                          </div>
                                        </div>
                                    </td>
                                </tr>
                                </volist>
                            </table>
                        </div>
                        <div class="tab-pane" id="finished">
                            <table class="table table-hover zt">
                                <tr>
                                    <th>订单编号</th>
                                    <th>收货人</th>
                                    <th>商品总额</th>
                                    <th>收货人手机</th>
                                    <th>收货地址</th>
                                    <th>下单时间</th>
                                    <th>详情</th>
                                </tr>
                                <volist name="list4" id="v">
                                <tr>
                                    <td>{$v.order_id}</td>
                                    <td>{$v.username}</td>
                                    <td>{$v.monery}</td>
                                    <td>{$v.phone}</td>
                                    <td>{$v.address}</td>
                                    <td>{$v.atime|date="Y-m-d H:i:s",###}</td>
                                    <td>
                                        <!-- Button trigger modal -->
                                        <button type="button" data-toggle="modal" data-target="#myModal{$v.id}"><span class="glyphicon glyphicon-pencil"></span></button>

                                        <!-- Modal -->
                                        <div class="modal fade" id="myModal{$v.id}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                                          <div class="modal-dialog">
                                            <div class="modal-content">
                                                <div class="modal-header">
                                                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                                                <h4 class="modal-title" id="myModalLabel">订单详情</h4>
                                                </div>
                                                <div class="modal-body">
                                                    <ul style="list-style:none;">
                                                        <li>商品编号:{$v.order_id}</li>
                                                        <li>订单状态:<if condition="$v.status eq '3'">已到货</if></li>
                                                        <li>商品信息:
                                                            <ul style="list-style:none;">
                                                                <li>商品名称:</li>
                                                                <li>商品名称:</li>
                                                                <li>商品名称:</li>
                                                                <li>商品名称:</li>
                                                            </ul>
                                                        </li>
                                                        <li>订单总价:{$v.monery}</li>
                                                        <li>收货人:{$v.username}</li>
                                                        <li>联系电话:{$v.phone}</li>
                                                    </ul>
                                                </div>
                                                <div class="modal-footer">
                                                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                                                    <button type="button" class="btn btn-primary">保存</button>
                                                </div>
                                            </div>
                                          </div>
                                        </div>
                                    </td>
                                </tr>
                                </volist>
                            </table>
                        </div>  <!--END tab-pane-->
                    </div>      <!--END tab-content-->
                    </div>      <!--END panel-body-->
            </div>              <!--END panel-primary-->
            </block>
            </div>              <!--END col-md-12-->
        </div>                  <!--END row-->
    </div>                      <!--END container-->
      
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
     <script src="__PUBLIC__/js/jquery-2.1.4.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="__PUBLIC__/admin/bootstrap/js/bootstrap.min.js"></script>
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
   


</body>
    <script>

    $(function(){

            $('.post').click(function(){
               var order_id= $(this).attr('data_index');
                $.ajax({
                   type:"POST",
                   url:"{:U('Admin/Order/post')}",
                   data: {'order_id':order_id},
                   success: function(msg){
                     $('#if').html( "订单状态: " + msg );
                   }
                });
            })      
    })


       
    </script>
</html>
